<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:o="http://openfaces.org/">

	<rich:modalPanel id="editImprovementDlg" width="450" height="400" zindex="10050">
		<f:facet name="header">
			<h:outputText value="#{messages['txt.improvement.addnew']}"/>
		</f:facet>
		
		<f:facet name="controls">
			<h:panelGroup>
				<h:graphicImage value="/img/close.png" styleClass="hidelink"
					id="hideEditImprovementDlg" />
				<rich:componentControl for="editImprovementDlg" attachTo="hideEditImprovementDlg"
					operation="hide" event="onclick" />
			</h:panelGroup>
		</f:facet>
		
		<h:form id="frmEditImprovement">
			<h:panelGroup rendered="#{interactiveViewerHelper.parcelDataHelper.improvement != null}">
				<div align="center">
					<h:outputText value="#{messages['txt.improvement.data']}" style="font-weight:bold;" />
					<rich:separator lineType="solid"/>
					<br />
					<h:panelGrid columns="2" style="width:100%">
						<h:outputLabel value="#{messages['txt.improvement.use']}" for="use" />
						<h:inputText id="use" value="#{interactiveViewerHelper.parcelDataHelper.improvement.use}" readonly="#{interactiveViewerHelper.parcelDataHelper.improvementEditMode == 'VIEWING'}" />
	
						<h:outputLabel value="#{messages['txt.improvement.easement_class']}" for="easement_class" />
						<h:inputText id="easement_class" value="#{interactiveViewerHelper.parcelDataHelper.improvement.easementClass}" readonly="#{interactiveViewerHelper.parcelDataHelper.improvementEditMode == 'VIEWING'}" />
	
						<h:outputLabel value="#{messages['txt.improvement.percentage_good']}" for="percentage_good" />
						<h:inputText id="percentage_good" value="#{interactiveViewerHelper.parcelDataHelper.improvement.percentageGood}" readonly="#{interactiveViewerHelper.parcelDataHelper.improvementEditMode == 'VIEWING'}" />
						
						<h:outputLabel value="#{messages['txt.improvement.year_built']}" for="year_built" />
						<h:inputText id="year_built" value="#{interactiveViewerHelper.parcelDataHelper.improvement.yearBuilt}" readonly="#{interactiveViewerHelper.parcelDataHelper.improvementEditMode == 'VIEWING'}" />
	
						<h:outputLabel value="#{messages['txt.improvement.number_of_floors']}" for="number_of_floors" />
						<h:inputText id="number_of_floors" value="#{interactiveViewerHelper.parcelDataHelper.improvement.numberOfFloors}" readonly="#{interactiveViewerHelper.parcelDataHelper.improvementEditMode == 'VIEWING'}" />
						
						<h:outputLabel value="#{messages['txt.improvement.front']}" for="front" />
						<h:inputText id="front" value="#{interactiveViewerHelper.parcelDataHelper.improvement.front}" readonly="#{interactiveViewerHelper.parcelDataHelper.improvementEditMode == 'VIEWING'}" />
						
						<h:outputLabel value="#{messages['txt.improvement.depth']}" for="depth" />
						<h:inputText id="depth" value="#{interactiveViewerHelper.parcelDataHelper.improvement.depth}" readonly="#{interactiveViewerHelper.parcelDataHelper.improvementEditMode == 'VIEWING'}" />
						
						<h:outputLabel value="#{messages['txt.improvement.area']}" for="area" />
						<h:inputText id="area" value="#{interactiveViewerHelper.parcelDataHelper.improvement.area}" readonly="#{interactiveViewerHelper.parcelDataHelper.improvementEditMode == 'VIEWING'}" />
						
						<h:outputLabel value="#{messages['txt.improvement.observation']}" for="observation" />
						<h:inputText id="observation" value="#{interactiveViewerHelper.parcelDataHelper.improvement.observation}" readonly="#{interactiveViewerHelper.parcelDataHelper.improvementEditMode == 'VIEWING'}" />
					</h:panelGrid>
					
					<br />
					<br />
					
					<h:outputText value="#{messages['txt.registry_data']}" style="font-weight:bold;" />
					<rich:separator lineType="solid"/>
					<br />
					<h:panelGrid columns="2">
						<h:outputLabel value="#{messages['txt.reg_number']}" for="reg_number3"/>
						<h:inputText
							id="reg_number3"
							label="#{messages['txt.reg_number']}"
							value="#{interactiveViewerHelper.parcelDataHelper.improvement.registration.code}"
							readonly="#{interactiveViewerHelper.parcelDataHelper.improvementEditMode == 'VIEWING'}">
						</h:inputText>

						<h:outputLabel value="#{messages['txt.tome']}" for="tome3"/>
						<h:inputText
							id="tome3"
							label="#{messages['txt.tome']}"
							value="#{interactiveViewerHelper.parcelDataHelper.improvement.registration.tome}"
							readonly="#{interactiveViewerHelper.parcelDataHelper.improvementEditMode == 'VIEWING'}">
						</h:inputText>
					
						<h:outputLabel value="#{messages['txt.folio']}" for="folio3" />
						<h:inputText 
							id="folio3"
							label="#{messages['txt.folio']}"
							value="#{interactiveViewerHelper.parcelDataHelper.improvement.registration.folio}"
							readonly="#{interactiveViewerHelper.parcelDataHelper.improvementEditMode == 'VIEWING'}">
						</h:inputText>
					
						<h:outputLabel value="#{messages['txt.annotation_number']}" for="annotation_number3"/>
						<h:inputText
							id="annotation_number3"
							label="#{messages['txt.annotation_number']}"
							value="#{interactiveViewerHelper.parcelDataHelper.improvement.registration.annotationNumber}"
							readonly="#{interactiveViewerHelper.parcelDataHelper.improvementEditMode == 'VIEWING'}">
						</h:inputText>
					</h:panelGrid>

					<h:panelGroup rendered="#{interactiveViewerHelper.parcelDataHelper.improvementEditMode == 'VIEWING'}">
						<o:commandButton
							type="button"
							value="#{messages['button.ok']}"
							onclick="#{rich:component('editImprovementDlg')}.hide()">
						</o:commandButton>
					</h:panelGroup>
					<h:panelGroup rendered="#{interactiveViewerHelper.parcelDataHelper.improvementEditMode != 'VIEWING'}">
						<a4j:commandButton
							value="#{messages['button.ok']}"
							action="#{interactiveViewerHelper.parcelDataHelper.acceptImprovement}"
							reRender="grpImprovement"
							oncomplete="if (#{facesContext.maximumSeverity == null}) #{rich:component('editImprovementDlg')}.hide(); else #{rich:component('msgPanel')}.show()">
						</a4j:commandButton>
						<o:commandButton
							type="button"
							value="#{messages['button.cancel']}"
							onclick="#{rich:component('editImprovementDlg')}.hide()">
						</o:commandButton>
					</h:panelGroup>
				</div>
			</h:panelGroup>
		</h:form>
	</rich:modalPanel>

</ui:composition>
